package com.syh.jn.scm.service.api.supplier.logistics.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by soci.song on 2018/10/18.
 */
public interface LogisticsBillEnums {

  @Getter
  @AllArgsConstructor
  public enum State {
    //物流状态
    UNDELIVERY(Short.valueOf("0"), "未发车", "物流状态"),
    DELIVEED(Short.valueOf("1"), "已发车", "物流状态"),
    SIGNIN(Short.valueOf("2"), "已收货", "物流状态");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static State valueOf(Short status) {
      switch (status) {
        case 0:
          return UNDELIVERY;
        case 1:
          return DELIVEED;
        case 2:
          return SIGNIN;
      }
      return null;
    }
  }

  @Getter
  @AllArgsConstructor
  public enum OrderType {

    SALE(Short.valueOf("0"), "销售单", "订单类型"),
    RETURN_SALE(Short.valueOf("1"), "销售退货单", "订单类型"),
    PURCHASE(Short.valueOf("2"), "采购单", "订单类型"),
    RETURN_PURCHASE(Short.valueOf("3"), "采购退货单", "订单类型");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static OrderType valueOf(Short status) {
      switch (status) {
        case 0:
          return SALE;
        case 1:
          return RETURN_SALE;
        case 2:
          return PURCHASE;
        case 3:
          return RETURN_PURCHASE;
      }
      return null;
    }
  }

  @Getter
  @AllArgsConstructor
  public enum CustomerType {
    // 往来单位类型
    UPSTREAM(Short.valueOf("0"), "上游", "往来单位类型"),
    DOWNSTREAM(Short.valueOf("1"), "下游", "往来单位类型"),
    LOGISTICS(Short.valueOf("2"), "物流", "往来单位类型");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static CustomerType valueOf(Short status) {
      switch (status) {
        case 0:
          return UPSTREAM;
        case 1:
          return DOWNSTREAM;
        case 2:
          return LOGISTICS;
      }
      return null;
    }
  }

  @Getter
  @AllArgsConstructor
  public enum LogisticsType {
    // 物流类型
    CAR(Short.valueOf("1"), "陆运", "物流类型"),
    FLIGHT(Short.valueOf("2"), "空运", "物流类型"),
    SHIPPING(Short.valueOf("3"), "海运", "物流类型");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static LogisticsType valueOf(Short status) {
      switch (status) {
        case 1:
          return CAR;
        case 2:
          return FLIGHT;
        case 3:
          return SHIPPING;
      }
      return null;
    }
  }

  @Getter
  @AllArgsConstructor
  public enum Statement {
    //物流结算状态
    NOT_STATEMENT(Short.valueOf("0"), "未生成对账单", "物流结算状态"),
    STATEMENT(Short.valueOf("1"), "已生成对账单", "物流结算状态"),
    CANCEL_STATEMENT(Short.valueOf("-1"), "取消对账单", "物流结算状态");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static Statement valueOf(Short status) {
      switch (status) {
        case 0:
          return NOT_STATEMENT;
        case 1:
          return STATEMENT;
        case -1:
          return CANCEL_STATEMENT;
      }
      return null;
    }
  }

  @Getter
  @AllArgsConstructor
  public enum FreightTake {

    //物流费用承担方
    BUY(Short.valueOf("0"), "买家承担", "运费承担方"),
    SALE(Short.valueOf("1"), "卖家承担", "运费承担方");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static FreightTake valueOf(Short status) {
      switch (status) {
        case 0:
          return BUY;
        case 1:
          return SALE;
      }
      return null;
    }
  }

  @Getter
  @AllArgsConstructor
  public enum FreightType {
    //物流费用承担方式
    BEFORE(Short.valueOf("0"), "预收买家", "运费承担方式"),
    AFTER(Short.valueOf("1"), "买家到付", "运费承担方式");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static FreightType valueOf(Short status) {
      switch (status) {
        case 0:
          return BEFORE;
        case 1:
          return AFTER;
      }
      return null;
    }
  }

  //发货类型
  @Getter
  @AllArgsConstructor
  public enum DeliveryType {
    LOGISTICS_TYPE(Short.valueOf("1"), "物流发货", "发货类型"),
    TRACKING_TYPE(Short.valueOf("2"), "快递发货", "发货类型"),
    OTHER_TYPE(Short.valueOf("3"), "其它发货", "发货类型");

    private Short deliveryType;
    private String deliveryName;
    private String deliveryBelong;

    @Override
    public String toString() {
      return this.deliveryType.toString();
    }

    public static DeliveryType valueOf(Short deliveryType) {
      switch (deliveryType) {
        case 1:
          return LOGISTICS_TYPE;
        case 2:
          return TRACKING_TYPE;
        case 3:
          return OTHER_TYPE;
      }
      return null;
    }
  }
}
